package com.mcc.myapplication.okhttp;

import java.io.IOException;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

public class OkHttpConfig {

    private static OkHttpClient client = new OkHttpClient();

    private OkHttpConfig() {
    }

    public static void get() {
        String url = "https://juejin.cn/post/7260772724182908986";
        Request request = new Request.Builder()
                .url(url)
                .build();
        try (Response response = client.newCall(request).execute()) {
            String res = response.body().string();
            System.out.println(res);
        } catch (IOException e) {
//            Log.e("", "");
            System.out.println(e.getMessage());
        }
    }


}
